package polymorphism;

/**
 * Created by admin on 2016-11-16.
 */
abstract class Person {

    private String name;

    private String sex;

    private int age;

    private String nationality;


    Person(){

    }

    Person(String name,String sex,int age,String nationality){
        this.name=name;
        this.sex=sex;
        this.age=age;
        this.nationality=nationality;
    }

    public void eat(){}

    public void sleep(){}

    public void work(){}

    public String getName() {
        return name;
    }

    public Person setName(String name) {
        this.name = name;
        return this;
    }

    public String getSex() {
        return sex;
    }

    public Person setSex(String sex) {
        this.sex = sex;
        return this;
    }

    public int getAge() {
        return age;
    }

    public Person setAge(int age) {
        this.age = age;
        return this;
    }

    public String getNationality() {
        return nationality;
    }

    public Person setNationality(String nationality) {
        this.nationality = nationality;
        return this;
    }

    public String toString(){
        return "Person name:"+name+" sex:"+sex+" age:"+age+" nationality:"+nationality;
    }
}






